from django import template

register = template.Library()

@register.filter
def range_filter(value):
    """返回一个从0到value-1的范围"""
    return range(value)

@register.simple_tag
def indent_level(level):
    """生成指定级别的缩进"""
    return '&nbsp;&nbsp;&nbsp;&nbsp;' * level